package com.xuexiang.xuidemo.page.text;

import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.Text;

import com.xuexiang.xui_lib.component.textview.autoFit.AutoFitHelper;
import com.xuexiang.xui_lib.component.textview.autoFit.AutoFitLayout;
import com.xuexiang.xui_lib.component.textview.autoFit.AutoFitTextView;
import com.xuexiang.xuidemo.ResourceTable;
import com.xuexiang.xuidemo.page.base.BasePageAbilitySlice;
import com.xuexiang.xuidemo.page.base.Page;

import java.util.Random;

/**
 * AutoFitText 自适应字体大小的文字
 *
 * @since 2021-04-06
 */
@Page(name = "自动断字换行文本", action = "AutoHyphenationTextAbilitySlice", ability = TextAbility.class)
public class AutoHyphenationTextAbilitySlice extends BasePageAbilitySlice{
    @Override
    protected int getLayoutId() {
        return ResourceTable.Layout_slice_auto_hyphenation_text;
    }

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        Component component = findComponentById(ResourceTable.Id_sl);
        component.scrollTo(0,0);
    }
}